#pragma once

#include <windows.h>
#include <string>

class SecureDesktopCapture {
public:
    SecureDesktopCapture();
    ~SecureDesktopCapture();

    bool Initialize();
    void Cleanup();
    bool CaptureSecureDesktop(HBITMAP& hBitmap, int& width, int& height);
    std::string GetLastError() const { return m_lastError; }

private:
    bool SwitchToSecureDesktop();
    bool CaptureFromSecureDesktop(HBITMAP& hBitmap, int& width, int& height);
    bool CaptureFromCurrentDesktop(HBITMAP& hBitmap, int& width, int& height);
    bool CaptureDirectScreen(HBITMAP& hBitmap, int& width, int& height);
    bool RestoreOriginalDesktop();

private:
    std::string m_lastError;
    HDESK m_originalDesktop;
    HDESK m_secureDesktop;
    bool m_initialized;
};